<!-- start: Wrapper -->
<?php
    $auth = $this->auth;


?>
<div id="wrapper">

    <!-- start: Container -->
    <div class="container">
        <!-- start: Portfolio -->
        <div id="portfolio-wrapper">
            <?php foreach($topics as $item): ?>
                <div class="one-third column portfolio-item" >
                    <div class="picture">
                        <a class="a" href="/topic/detail/<?php echo $item->id ?>" title="Title">
                            <img src="<?php echo $item->images ?>" alt="">
                            <div class="image-overlay-link"></div></a>
                        <div class="item-description alt">
                            <h5><a href="/topic/detail/<?php echo $item->id ?>"><?php echo $item->title ?></a></h5>
                            <p><?php echo $item->short_description ?></p>
                        </div>
                        <div class="post-meta"><span><i class="mini-ico-calendar"></i>
                                <?php    $datetime = strtotime($item->create_date); echo date("m/d/Y", $datetime); ?>
                            </span>
                            <span><i class="mini-ico-user"></i> <a href="#"><?php $user = \Velacolib\Utility\Utility::GetUserInfo($item->user_id,'Admin\Model\AdminUserTable'); echo $user->name; ?></a></span>
                            <span><i class="mini-ico-comment"></i><a href="#">85</a></span>
                        </div>
                    </div>
                </div>
            <?php  endforeach ?>
            <!-- from user -->
            <input type="hidden"  id="_from_user_name" value="<?php if( $auth->getIdentity()) echo $auth->getIdentity()->name; ?>" />
            <input type="hidden"  id="_form_user_email" value="<?php  if( $auth->getIdentity()) echo $auth->getIdentity()->email; ?>" />
            <input type="hidden"  id="_form_user" value="<?php  if( $auth->getIdentity()) echo $auth->getIdentity()->userid; ?>" />
            <!-- to user -->
            <input type="hidden"  id="_to_user_name" value="<?php  if( $auth->getIdentity()) echo $user->name; ?>" />
            <input type="hidden"  id="_to_user_email" value="<?php  if( $auth->getIdentity()) echo $user->email; ?>" />
            <input type="hidden"  id="_to_user" value="<?php  if( $auth->getIdentity()) echo $user->id; ?>" />
        </div>
        <!-- end: Portfolio -->
        <!--paginator -->
        <div class="row-fluid" align="center">
            <?php
            // add at the end of the file after the table
            echo $this->paginationControl(
            // the paginator object
                $topics,
                // the scrolling style; see http://zf2.readthedocs.org/en/release-2.1.4/modules/zend.paginator.usage.html#rendering-pages-with-view-scripts
                'sliding',
                // the partial to use to render the control
                array('partial/paginator.phtml', 'Topic'),
                // the route to link to when a user clicks a control link
                array(
                    'route' => 'frontenduser',
                    'child_route' => array(
                        'controller'=>'user',
                        'action' => 'topic',
                        'param'=>$param,
                    )
                )
            );
            ?>
        </div>
        <!--end paginator -->
        <div style="margin: 0 auto" class="loading">Loading...</div>
    </div>
</div>
